import bus from "./bus"

const baseUrl = process.env.VUE_APP_API_BASE_URL
const baseSocketUrl = process.env.VUE_APP_API_BASE_SOCKET_URL
/**
 * 基础模块接口定义
 */
const api = {
  //网络请求成功状态值
  HTTP_OK_STATUS: 100,
  Login: "login/token",
  websocket: baseSocketUrl + "/websocket",
  Logout: "/auth/logout",
  ForgePassword: "/auth/forge-password",
  Register: "/auth/register",
  twoStepCode: "/auth/2step-code",
  SendSms: "/account/sms",
  SendSmsErr: "/account/sms_err",
  // get my info
  UserInfo: "/user/info",
  common: {
    showState: [{ label: "禁用", value: 0 }, { label: "启用", value: 1 }],
    sexType: [{ label: "女", value: 0 }, { label: "男", value: 1 }],
    userStatus: [{ label: "正常", value: 1 }, { label: "禁用", value: 0 }],
    dictDataType: [{ label: "字符串", value: 1 }, { label: "数组", value: 2 }],
    ossType: [{ label: "本地服务器", value: "LOCAL_OSS" }, { label: "阿里云", value: "ALI_OSS" }],
    pushType: [{ label: "极光", value: "PUSH_JG" }],
    imType: [{ label: "融云", value: "IM_RONGCLOUD" }],
    displayState: [{ label: "显示", value: true }, { label: "隐藏", value: false }],
    authState: [{ label: "否", value: 0 }, { label: "是", value: 1 }],
    status: [{ label: "否", value: 0 }, { label: "是", value: 1 }],
    searchRang: [{ label: "全部", value: 1 }, { label: "个人", value: 2 }],
    menuLayout: [{ label: "PageView", value: "PageView" }, { label: "RouteView", value: "RouteView" }],
    auditState: [{ label: "待审核", value: 1 }, { label: "通过", value: 2 }, { label: "退回", value: 10 }]
  },
  config: {
    oss: "config/oss",
    ossSave: "config/ossSave",
    pushSave: "config/pushSave",
    sms: "config/sms",
    get: "config/get",
    smsSave: "config/smsSave",
    getByKey: "config/getByKey",
    getCommonConfig: "config/getCommonConfig",
    saveIm: "config/saveIm",
    commonConfigSave: "config/commonConfigSave",
    globalConfigSave: "config/globalConfigSave"
  },
  collecon: {
    totalByTargetEntity: "collecon/totalByTargetEntity"
  },
  suk: {
    page: "suk/page"
  },
  baseApi: {
    page: "api/page",
    add: "api/add",
    update: "api/update",
    remove: "api/remove",
    all: "api/all",
    batchRemove: "api/batch/remove",
    batchUpdateOpen: "api/batch/update/open",
    batchUpdateStatus: "api/batch/update/status",
    setAuthState: "api/setAuthState"
  },
  /**
   * 网关
   */
  gateway: {
    list: "gateway/list"
  },
  menu: {
    add: "menu/add",
    update: "menu/update",
    list: "menu/all",
    setState: "menu/setState",
    remove: "menu/remove"
  },
  payconfig: {
    page: "payconfig/page",
    setPayStatus: "payconfig/setPayStatus",
    setIsTest: "payconfig/setIsTest",
    update: "payconfig/update"
  },
  balance: {
    page: "pay/balance/page",
    list: "pay/balance/list",
    add: "pay/balance/save",
    exportUrl: "pay/balance/export",
    update: "pay/balance/update",
    remove: "pay/balance/remove"
  },
  balanceLog: {
    page: "pay/pbl/page",
    list: "pay/pbl/list",
    add: "pay/pbl/save",
    exportUrl: "pay/pbl/export",
    update: "pay/pbl/update",
    remove: "pay/pbl/remove"
  },
  file: {
    upload: baseUrl + "/file/upload",
    upload2: baseUrl + "/file/upload2",
    remove: "file/remove",
    list: "file/list"
  },
  area: {
    getPro: "area/getPro",
    getCity: "area/getCity",
    getArea: "area/getArea",
    selectByMaxLevel: "area/selectByMaxLevel",
    getAreaAll: "area/all"
  },
  //后台管理用户
  managerUser: {
    page: "manager/user/page",
    add: "manager/user/add",
    remove: "manager/user/remove",
    changeCompany: "manager/user/changeCompany",
    setStatus: "manager/user/setStatus",
    update: "manager/user/update",
    setRole: "manager/user/setRole",
    setCompany: "manager/user/setCompany",
    setDept: "manager/user/setDept",
    getAuthDeptList: "manager/user/getAuthDeptList",
    getAuthFieldList: "manager/user/getAuthFieldList",
    getAuthDataScopeList: "manager/user/getAuthDataScopeList",
    setAuthField: "manager/user/setAuthField",
    setAuthDataScope: "manager/user/setAuthDataScope",
    password: "manager/user/update/password",
    userStatus: [{ label: "正常", value: 1 }, { label: "禁用", value: 0 }],
    userType: [{ label: "超级管理员", value: "super" }, { label: "普通管理员", value: "normal" }]
  },
  //前台APP用户
  frontUser: {
    page: "api/front/user/page",
    add: "api/front/user/add",
    get: "api/front/user/get",
    remove: "api/front/user/remove",
    setStatus: "api/front/user/setStatus",
    update: "api/front/user/update",
    password: "api/front/user/resetPwd"
  },
  appAccount: {
    page: "front/account/page",
    add: "front/account/add",
    remove: "front/account/remove",
    update: "front/account/update",
    password: "front/account/update/password"
  },
  company: {
    page: "company/page",
    list: "company/list",
    add: "company/save",
    get: "company/get",
    getAccount: "company/getByAccount",
    setAuditState: "company/setAuditState",
    setErpStateState: "company/setErpStateState",
    setRecommend: "company/setRecommend",
    getAuthCompanyList: "company/getAuthCompanyList",
    setCompanyState: "company/setCompanyState",
    update: "company/edit",
    remove: "company/delete",
    companyStatus: [{ label: "未启用", value: 0 }, { label: "已启用", value: 1 }],
    authStatus: [{ label: "未认证", value: 0 }, { label: "待审核", value: 1 }, { label: "已认证", value: 2 }, {
      label: "审核失败",
      value: 3
    }]
  },
  shop: {
    page: "shop/page",
    add: "shop/add",
    get: "shop/get",
    setShopState: "shop/setShopState",
    list: "shop/list",
    setAuditState: "shop/setAuditState",
    setRecommend: "shop/setRecommend",
    update: "shop/edit",
    remove: "shop/remove",
    shopState2: [{ label: "上架", value: 2 }, { label: "违规下架", value: 10 }],
    shopState: [{ label: "未审核", value: 0 }, { label: "已上架", value: 2 }, { label: "违规下架", value: 10 }]
  },
  //店铺分类
  shopType: {
    list: "api/system/type/list",
    page: "api/system/type/page",
    add: "api/system/type/save",
    get: "api/system/type/get",
    delete: "api/system/type/delete",
    update: "/api/system/type/update"
  },
  dict: {
    initDict: "dict/initDict",
    list: "dict/list",
    add: "dict/add",
    update: "dict/update",
    remove: "dict/delete"
  },
  html: {
    list: "api/html/list",
    add: "api/html/save",
    update: "api/html/update",
    remove: "api/html/delete"
  },
  dictData: {
    page: "dictdata/page",
    add: "dictdata/add",
    setState: "dictdata/setState",
    update: "dictdata/update",
    setUser: "dictdata/users/add",
    remove: "dictdata/remove",
    dicStatus: [{ label: "启用", value: 1 }, { label: "禁用", value: 0 }]
  },

  role: {
    page: "role/page",
    add: "role/add",
    update: "role/update",
    getAuthRoleList: "role/getAuthRoleList",
    listByType: function(roleType) {
      return `role/listByType/${roleType}`
    },
    getAuthFieldList: "role/getAuthFieldList",
    getAuthDataScopeList: "role/getAuthDataScopeList",
    setAuthField: "role/setAuthField",
    setAuthDataScope: "role/setAuthDataScope",
    setUser: "role/users/add",
    remove: "role/remove"
  },
  bbsContent: {
    page: "api/bbs/content/page",
    add: "api/bbs/content/save",
    setState: "api/bbs/content/setState",
    get: "api/bbs/content/get",
    update: "api/bbs/content/update",
    remove: "api/bbs/content/delete"
  },
  bbsComment: {
    page: "api/bbs/comment/page",
    get: "api/bbs/comment/get",
    delete: "/api/bbs/comment/delete"
  },
  avmVideo: {
    page: "api/avm/video/page",
    update: "avm/video/update",
    setState: "api/avm/video/setState",
    get: "api/avm/video/get",
    delete: "api/avm/video/delete"
  },
  avmVideoComment: {
    page: "api/avm/avc/page",
    get: "api/avm/avc/get",
    delete: "api/avm/avc/delete"
  },
  cmsContent: {
    page: "cms/content/page",
    add: "cms/content/save",
    setState: "cms/content/setState",
    get: "api/cms/content/get",
    update: "cms/content/update",
    remove: "cms/content/delete"
  },
  cmsComment: {
    page: "cms/comment/page",
    delete: "/api/cms/comment/delete"
  },
  inteActivity: {
    page: "interact/activity/page",
    delete: "interact/activity/delete",
    get: "interact/activity/get",
    add: "interact/activity/save",
    update: "interact/activity/update",
    setRecommend: "interact/activity/setRecommend",
    setState: "interact/activity/setState"
  },
  coupon: {
    page: "/api/coupon/page",
    delete: "/api/coupon/delete",
    get: "/api/coupon/get",
    add: "/api/coupon/save",
    update: "/api/coupon/update"
  },
  link: {
    page: "link/page",
    add: "link/add",
    setSendStatus: "link/setSendStatus",
    update: "link/update",
    remove: "link/delete"
  },
  version: {
    page: "api/version/page",
    add: "api/version/save",
    get: "api/version/get",
    setForceUpdate: "api/version/setForceUpdate",
    update: "api/version/update",
    remove: "api/version/delete"
  },

  feedback: {
    page: "api/feedback/page",
    get: "api/feedback/get",
    setState: "api/feedback/setState",
    update: "api/feedback/update",
    remove: "api/feedback/delete"
  },
  authority: {
    user: "authority/user/grant",
    role: "authority/role/grant"
  },
  brand: {
    page: "brand/page",
    setRecommend: "brand/setRecommend",
    add: "brand/add",
    update: "brand/update",
    delete: "brand/delete",
    get: "brand/get"
  },
  marketing: {
    page: "product/marketing/page",
    update: "product/marketing/update",
    remove: "product/marketing/delete",
    batchAdd: "product/marketing/batchAdd"
  },
  product: {
    add: "product/add",
    page: "product/page",
    setOnLineState: "product/setOnLineState",
    setRecommend: "product/setRecommend",
    getSkuList: "product/sku/list",
    remove: "product/remove",
    update: "product/update",
    totalProduct: "product/totalProduct",
    get: "product/get"
  },
  topic: {
    page: "product/topic/page",
    get: "product/topic/get",
    add: "product/topic/save",
    setState: "product/topic/setState",
    update: "product/topic/update",
    topicType: [{ label: "限时秒杀", value: 2 }, { label: "限时抢购", value: 1 }, { label: "每周精选", value: 3 }],
    remove: "product/topic/delete"
  },
  specs: {
    page: "specs/page",
    add: "specs/save",
    setState: "specs/setState",
    update: "specs/update",
    remove: "specs/delete",
    specsType: [{ label: "文本", value: 2 }, { label: "颜色", value: 1 }]
  },
  type: {
    list: "system/type/list"
  },
  //消息类型
  msgType: {
    setTypeState: "msg/type/setTypeState",
    setSortOrder: "msg/type/setSortOrder",
    page: "msg/type/page",
    list: "msg/type/list",
    add: "msg/type/save",
    update: "msg/type/update",
    pushDeviceType: [{ label: "全部", value: 0 }, { label: "Android", value: 1 }, { label: "IOS", value: 2 }],
    sendType: [{ label: "立即发送", value: 0 }],
    remove: "msg/type/remove"
  },
  //消息内容
  content: {
    setMsgState: "msg/content/setMsgState",
    sendMessage: "msg/content/sendMessage",
    page: "msg/content/page",
    add: "msg/content/save",
    get: "msg/content/get",
    update: "msg/content/update",
    remove: "msg/content/remove"
  },
  //订单管理
  order: {
    page: "order/listByShop",
    cancel: "order/cancel",
    remove: "order/delete",
    update: "order/update",
    totalSaleByType: "order/totalSaleByType",
    getSaleByCateGory: "order/getSaleByCateGory",
    getTotalData: "order/getTotalData",
    countByOrderState: "order/countByOrderState",
    get: "order/get"
  },
  settle: {
    exportUrl: "order/export",
    page: "order/totalSale",
    settleType: [{ label: "应结金额1", value: 1 }, { label: "应结金额2", value: 2 }, { label: "应结金额3", value: 3 }],
    totalSaleByShop: "order/totalSaleByShop"
  },
  //订单明细
  orderDetails: {
    list: "order/details/list"
  },
  //订单物流
  orderLogistics: {
    get: "order/logistics/get",
    update: "order/logistics/update"
  },
  //发票
  invoice: {
    page: "invoice/page",
    get: "invoice/get",
    remove: "invoice/remove",
    update: "invoice/update",
    invoiceState: [{ label: "已开", value: 1 }, { label: "未开", value: 0 }]
  },
  logistics: {
    list: "logistics/list",
    page: "logistics/page",
    add: "logistics/save",
    get: "logistics/get",
    update: "logistics/update",
    remove: "logistics/delete"
  },
  //售后保障
  aftersale: {
    page: "product/aftersale/page",
    add: "product/aftersale/save",
    get: "product/aftersale/get",
    setState: "product/aftersale/setState",
    update: "product/aftersale/update",
    remove: "product/aftersale/delete"
  },
  //售后服务
  afterService: {
    page: "order/afterservice/page",
    update: "order/afterservice/update",
    remove: "order/afterservice/delete",
    serviceType: [{ label: "维修", value: 1 }, { label: "退货", value: 2 }, { label: "换货", value: 3 }]
  },
  //售后原因
  cause: {
    list: "order/cause/list"
  },
  //订单评价
  evaluate: {
    page: "order/evaluate/page",
    remove: "order/evaluate/delete"
  },
  //商品分类
  category: {
    first: "product/category/first",
    add: "product/category/add",
    update: "product/category/edit",
    remove: "product/category/remove",
    list: "product/category/list",
    second: "product/category/second"
  },
  //商品规格模板
  specscategory: {
    getSpecsCategory: "specscategory/getSpecsCategory",
    add: "specscategory/add",
    update: "specscategory/update"
  },
  //银行账户
  bank: {
    page: "system/bank/page",
    add: "system/bank/save",
    list: "system/bank/list",
    saveOrUpdate: "system/bank/saveOrUpdate",
    get: "system/bank/get",
    update: "system/bank/update",
    remove: "system/bank/remove"
  },
  organization: {
    page: "system/organization/page",
    list: "system/organization/list",
    get: "system/organization/get",
    add: "system/organization/save",
    update: "system/organization/update",
    remove: "system/organization/remove"
  },
  process: {
    page: "bpm/process/page",
    list: "bpm/process/list",
    get: "bpm/process/get",
    add: "bpm/process/save",
    authList: "bpm/process/auth/list",
    authAdd: "bpm/process/auth/save",
    authDel: "bpm/process/auth/delete",
    update: "bpm/process/update",
    remove: "bpm/process/remove",
    deploy: "bpm/process/deploy",
    identityType: [{ label: "用户", value: 1 }, { label: "角色", value: 2 }]
  },
  model: {
    page: "bpm/model/page",
    list: "bpm/model/list",
    deploy: "bpm/model/deploy",
    queryById: "bpm/model/queryById",
    add: "bpm/model/save",
    update: "bpm/model/update"
  },
  processInstance: {
    page: "bpm/processInstance/page",
    update: "bpm/processInstance/update",
    queryById: "bpm/processInstance/queryById",
    comments: "bpm/processInstance/comments",
    taskList: "bpm/task/list",
    formData: "bpm/processInstance/formData",
    remove: "bpm/processInstance/delete",
    start: "bpm/processInstance/start"
  },
  //首页统计
  homeTotal: {
    totalCount: "bus/order/totalCount",
    totalSaleByType: "bus/bod/totalSaleByType"
  },
  //职务
  position: {
    page: "front/position/page",
    list: "front/position/list"
  },
  //前端字段控制
  field: {
    add: "field/add",
    update: "field/update"
  },
  //数据权限
  dataScope: {
    add: "dataScope/add",
    update: "dataScope/update"
  },
  //租户
  tenant: {
    page: "system/tenant/page",
    list: "system/tenant/list",
    get: "system/tenant/get",
    add: "system/tenant/save",
    update: "system/tenant/update",
    remove: "system/tenant/remove"
  },
  //打印模板
  spd: {
    page: "system/spd/page",
    list: "system/spd/list",
    get: "system/spd/get",
    add: "system/spd/save",
    update: "system/spd/update",
    remove: "system/spd/remove"
  }
}
const all = Object.assign({}, api, bus)
export default all
